QuadDictionary class¶
Attributes: [DefaultMember("Item")] [DebuggerDisplay("QuadDictionary: {Count}")]
Defined in
Namespace: ReactiveList.Reactive.Collections Assembly: ReactiveList.Reactive.dll Full name: ReactiveList.Reactive.Collections.QuadDictionary<T1, T2> Modifiers: public sealed
Summary¶
View source (opens in a new tab)
Provides a high-performance, pooled hash table for storing key/value pairs, supporting fast lookup and insertion
operations with customizable key equality comparison.
Applies to
net11.0, net10.0, net47, net471, net472, net48, net481
Class hierarchy
classDiagram
class QuadDictionary~T1,T2~
class IQuad~KeyValuePair~TKey, TValue~~ {
<>
}
IQuad~KeyValuePair~TKey, TValue~~ <|.. QuadDictionary~T1,T2~
class IEnumerable~KeyValuePair~TKey, TValue~~ {
<>
}
IEnumerable~KeyValuePair~TKey, TValue~~ <|.. QuadDictionary~T1,T2~
class IEnumerable {
<>
}
IEnumerable <|.. QuadDictionary~T1,T2~
class IDisposable {
<>
}
IDisposable <|.. QuadDictionary~T1,T2~
Implements: IQuad
Remarks¶
QuadDictionary is an internal shard optimized for scenarios where frequent additions and lookups are required,
and memory efficiency is important. It uses array pooling to minimize allocations and supports custom equality
comparers for keys. The dictionary is not thread-safe and should not be accessed concurrently from multiple threads.
Call Dispose to return internal arrays to the pool when the dictionary is no longer needed.
Change notifications are NOT emitted from this class - the parent QuaternaryDictionary handles all notifications
through its Stream pipeline.
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the QuadDictionary class with default settings. |
Properties¶
| Name | Summary |
|---|---|
| Count | Gets the number of key/value pairs contained in the dictionary. |
| Keys | Gets all keys in the dictionary. |
| Values | Gets all values in the dictionary. |
| this[] | Gets or sets the value associated with the specified key. |
Methods¶
| Name | Summary |
|---|---|
| GetValueRefOrAddDefault | Gets a reference to the value for the specified key, adding a default entry if the key does not exist. |
| TryAdd | Attempts to add the specified key and value to the dictionary. |
| Add | Adds the specified key and value to the dictionary. |
| TryGetValue | Gets the value associated with the specified key. |
| ContainsKey | Determines whether the dictionary contains the specified key. |
| Remove | Removes the value with the specified key from the dictionary. |
| Clear | Removes all keys and values from the dictionary. |
| EnsureCapacity | Ensures that the dictionary can hold up to the specified number of entries without resizing. |
| GetEnumerator | Returns an enumerator that iterates through the dictionary. |
| CopyKeysTo | Copies all keys to a list. |
| CopyValuesTo | Copies all values to a list. |
| CopyTo | Copies all key/value pairs to a list. |
| Dispose | Returns arrays to pool and cleans up resources. |
Inherited members
System.Object.Equals(System.Object)(opens in a new tab)System.Object.Equals(System.Object,System.Object)(opens in a new tab)System.Object.GetHashCode(opens in a new tab)System.Object.GetType(opens in a new tab)System.Object.MemberwiseClone(opens in a new tab)System.Object.ReferenceEquals(System.Object,System.Object)(opens in a new tab)System.Object.ToString(opens in a new tab)